/*
 * @(#)VCRAdapter.java   2009.02.24 at 09:44:51 PST
 *
 * Copyright 2007 MBARI
 *
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1
 * (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.gnu.org/copyleft/lesser.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */



/* Generated by Together */
package org.mbari.vcr;

import org.mbari.movie.Timecode;

/**
 * <p>
 * Abstract implementation of IVCR. This class creates VCRReply for all child
 * classes.
 * </p>
 *
 * @author : $Author: hohonuuli $
 * @version : $Revision: 332 $
 */
public class VCRAdapter implements IVCR {

    /**
     *     @uml.property  name="vcrReply"
     *     @uml.associationEnd
     */
    protected IVCRReply vcrReply;

    /** Disconnect from the VCR */
    public void disconnect() {
        removeAllObservers();
    }

    /** Eject a tape */
    public void eject() {

        // No implementation
    }

    /** Fast forward the tape */
    public void fastForward() {

        // No implementation
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getConnectionName() {
        return "Not connected";
    }

    /**
     * <p><!-- Method description --></p>
     *
     *
     * @return
     */
    public IVCRError getVcrError() {
        return getVcrReply().getVcrError();
    }

    /**
     *     <p><!-- Method description --></p>
     *     @return
     *     @uml.property  name="vcrReply"
     */
    public IVCRReply getVcrReply() {
        if (vcrReply == null) {
            vcrReply = new VCRReplyAdapter();
        }

        return vcrReply;
    }

    /**
     * <p><!-- Method description --></p>
     *
     *
     * @return
     */
    public IVCRState getVcrState() {
        return getVcrReply().getVcrState();
    }

    /**
     * <p><!-- Method description --></p>
     *
     *
     * @return
     */
    public IVCRTimecode getVcrTimecode() {
        return getVcrReply().getVcrTimecode();
    }

    /**
     * <p><!-- Method description --></p>
     *
     *
     * @return
     */
    public IVCRUserbits getVcrUserbits() {
        return getVcrReply().getVcrUserbits();
    }

    /**
     * The <i>Sony 9-pin protocol </i> does not provide a pause command. A
     * clever programmer could implement this though.
     */
    public void pause() {

        // No implementation
    }

    /** Play the tape */
    public void play() {

        // No implementation
    }

    /**
     * preset the VCR's timecode to a specified timecode
     *
     * @param timecode
     *            The timecode to set the VCR to. Refer to Sony 9-pin protocol
     *            for the format of the timecode.
     */
    public void presetTimecode(byte[] timecode) {

        // No implementation
    }

    /**
     * preset the VCR's user bits to a specified userbit code
     *
     * @param userbits
     *            The user bits to set the VCR to. Refer to Sony 9-pin protocol
     *            for the format of the timecode.
     */
    public void presetUserbits(byte[] userbits) {

        // No implementation
    }

    /** start recording */
    public void record() {

        // No implementation
    }

    /** Releases the tape */
    public void releaseTape() {

        // No implementation
    }

    /** Remove all observers from the reply, state, timecode, and error objects. */
    public void removeAllObservers() {
        getVcrState().removeAllObservers();
        getVcrReply().removeAllObservers();
        getVcrError().removeAllObservers();
        getVcrTimecode().removeAllObservers();
        getVcrUserbits().removeAllObservers();
    }

    /**
     * Query the VCR for its type. Return codes are MODEL Data-1 Data-2 <br>
     * BVH-2000(00) 00 11 <br>
     * BVH-2000(02) 00 10 <br>
     */
    public void requestDeviceType() {

        // No implementation
    }

    /**
     * Get longitudial timecode, which is stored on the audio track. Not as
     * accurate as getVTimeCode, but this method will get timecodes during
     * fast-forwards, rewinds and shuttiling
     */
    public void requestLTimeCode() {

        // No implementation
    }

    /**
     * <p><!-- Method description --></p>
     *
     */
    public void requestLUserbits() {

        // No implementation
    }

    /**
     * <p><!-- Method description --></p>
     *
     */
    public void requestLocalDisable() {

        // No implementation
    }

    /**
     * <p><!-- Method description --></p>
     *
     */
    public void requestLocalEnable() {

        // No implementation
    }

    /** Send a "get status" command to the VCR */
    public void requestStatus() {

        // No implementation
    }

    /**
     * <p><!-- Method description --></p>
     *
     */
    public void requestTimeCode() {

        // No implementation
    }

    public void requestUserbits() {

        // No implementation
    }

    /**
     * Get vertical timecode, which is stored between video frames. These
     * timecodes can not be accessed in any mode accept play mode. So use
     * getLTimeCode when fast-forwarding, rewinding, or shuttling
     */
    public void requestVTimeCode() {

        // No implementation
    }

    /**
     * <p><!-- Method description --></p>
     *
     */
    public void requestVUserbits() {

        // No implementation
    }

    /** Rewind the tape */
    public void rewind() {

        // No implementation
    }

    /**
     * seek to a specified timecode
     *
     * @param timecode
     *            The timecode to seek. Refer to Sony 9-pin protocol for the
     *            format of the timecode.
     */
    public void seekTimecode(byte[] timecode) {

        // No implementation
    }

    /**
     * seek to a specified timecode
     *
     * @param timecode
     *            The timecode to seek. Refer to Sony 9-pin protocol for the
     *            format of the timecode.
     */
    public void seekTimecode(int timecode) {

        // No implementation
    }

    public void seekTimecode(Timecode timecode) {

        // No implementation
    }

    /**
     * Shuttle forward
     *
     * @param speed
     *            A value between 0 (VERY slow) and 255 (Fast)
     */
    public void shuttleForward(int speed) {

        // No implementation
    }

    /**
     * Shuttle backwards
     *
     * @param speed
     *            A value between 0 (VERY slow) and 255 (Fast)
     */
    public void shuttleReverse(int speed) {

        // No implementation
    }

    /** Stop the tape */
    public void stop() {

        // No implementation
    }

    public void kill() {
        // no implementation
    }
}
